package com.spider.silence.job;

import com.spider.silence.downloader.ZuiChengduDownLoader;
import com.spider.silence.pool.ZuiChengduDownLoaderPool;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.StatefulJob;

/**
 * @author 夏茂轩
 * @package com.spider.silence.job
 * @Date 2017/1/11 14:49
 * @description 最成都定时采集Job
 */
public class ZuiChengDuJob implements StatefulJob {
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        ZuiChengduDownLoader downLoader =null;
        try {
            downLoader = ZuiChengduDownLoaderPool.getInstance().fetchDownLoader(1000);
            downLoader.generateTask();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }finally {
            ZuiChengduDownLoaderPool.getInstance().releaseDownLoader(downLoader);
        }
    }
}
